package com.iwhalecloud.citybrain.flow.platform.manager.domain.repository;

import com.iwhalecloud.citybrain.flow.platform.manager.domain.enums.NextNodeParamEnum;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.model.FlowNodeTempParamDomain;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;
import java.util.Objects;

@SpringBootTest
@RunWith(SpringRunner.class)
public class FlowNodeTempParamRepositoryTest {

    @Autowired
    private FlowNodeTempParamRepository flowNodeTempParamRepository;

    @Test
    public void listNodeTempParam() {

        String processInstanceId = "9a73814ae57411eb965b00ff0cbced97";
        String nodeCode = "test3";
        List<FlowNodeTempParamDomain> flowNodeTempParamList = flowNodeTempParamRepository.listNodeTempParam(
                processInstanceId,nodeCode, NextNodeParamEnum.NEXT_NODE_ASSIGNEE);
        if (Objects.nonNull(flowNodeTempParamList) && flowNodeTempParamList.size()>0){
            System.out.println(flowNodeTempParamList.get(0).getParamCode());
            System.out.println(flowNodeTempParamList.get(0).getParamValue());
            System.out.println(flowNodeTempParamList.get(0).getParamType());
        }else{
            System.out.println("null");
        }
    }
}